package com.atguigu.spzx.manage.controller;


import com.atguigu.spzx.model.entity.system.Banner;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.atguigu.spzx.manage.service.ClientBannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/client/system/banner")
@Slf4j
@Tag(name = "client轮播图接口")
public class ClientBannerController {
    @Autowired
    private ClientBannerService clientBannerService;

    //查询is_up上架的所有轮播图
    @Operation(summary = "客户端轮播图查询")
    @GetMapping(value = "/getBanner")
    public Result getBanner(){
        List<Banner> clientBannerList=clientBannerService.getClientBannerList();
        return Result.build(clientBannerList, ResultCodeEnum.SUCCESS);
    }


}
